﻿<%@ Page Language="C#" AutoEventWireup="true" Theme="Default" CodeBehind="YongHuCLCX.aspx.cs" Inherits="Web.Pages.YongShui._1.JiChuXX.YongHuCLCX" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>用户材料信息查询</title>
    <script type="text/javascript" src="../../../JS/AddEditCancel.js"></script>
    <script type="text/javascript">
        function del(id)
        {
            if (confirm('确认要删除吗?'))
            {
                hdCollection.Set("ID", id);
                ASPxCallback1.PerformCallback("del");
            }
        }

        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            var specialIdentity = arr[2];
            var msg = arr[3].split('-');
            if (msg[0] == 'True') {
                alert(msg[1]);
               
            }
            hdCollection.Set("type", type);
            if (state == 'True') {
                if (type == "del") {
                    Bind();
                }
            }
            else {

            }
        }
        //function CallBackFunction(rs) {
        //    if (rs != "")
        //    {
        //        var result = rs;
        //        if (result == "1")
        //            alert("删除成功！");
        //    }
        //    Bind();
        //}
        function SelectChange() {


            Bind();
        }
        function SelectUser(s) {
            hdCollection.Set("yonghuh", txtYongHuH.GetText());
            Bind();
        }
        function Bind() {
            hdCollection.Set("yonghuh", txtYongHuH.GetText());
            hdCollection.Set("cllb", cmCaiLiaoLB.GetValue());
            hdCollection.Set("cllbmc", cmCaiLiaoLB.GetText());

            hdCollection.Set("start", DateStart.GetText());

            hdCollection.Set("end", DateEnd.GetText());
            grid.PerformCallback();
        }
        function OnInit(s, e) {
            AdjustSize();
        }
        function OnEndCallback(s, e) {
            AdjustSize();
        }

        function AdjustSize() {
            var height = Math.max(0, document.documentElement.clientHeight  - 100);
            grid.SetHeight(height);
        }

        function FH() {
            location = "YongHuZLSC.aspx";
        }
        window.onunload = function () {

            try {
                var open = window.opener;    //第三方跨域
                open.GaoPaiSC();
            } catch (error) {
         
            }
           
            
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        
        <div style="display: none;">
           <%-- <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
            <dx:ASPxCallback ID="Call" ClientInstanceName="Call" 
                OnCallback="Call_Callback" 
                ClientSideEvents-CallbackComplete="function(s,e){CallBackFunction(e.result);}" 
                runat="server"></dx:ASPxCallback>--%>
            <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
        <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div>
                    <div class="tabletitle1" align="center">
                        用户材料信息查询
                    </div>
                    <table style="width: 100%">
                        <tr>
                            <td style="width: 70px">用户号：
                            </td>
                            <td style="width: 150px">
                                <dx:ASPxTextBox ID="txtYongHuH" ClientInstanceName="txtYongHuH" runat="server" Width="90%" MaxLength="7">
                                    <ClientSideEvents KeyPress="function(s,e){SelectUser(s);}" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 80px">文件类型：
                            </td>
                            <td style="width: 180px">
                                <dx:ASPxComboBox ID="cmCaiLiaoLB" ClientInstanceName="cmCaiLiaoLB" runat="server" Width="96%" ValueType="System.String">
                                    <ClientSideEvents SelectedIndexChanged="function(s,e){SelectChange();}" />
                                </dx:ASPxComboBox>
                            </td>
                            <td style="width: 80px">操作时间：
                            </td>
                            <td style="width: 120px">
                                <dx:ASPxDateEdit ID="DateStart" ClientInstanceName="DateStart" runat="server" Width="96%"></dx:ASPxDateEdit>
                            </td>
                            <td style="width: 20px" align="center">-
                            </td>
                            <td style="width: 120px">
                                <dx:ASPxDateEdit ID="DateEnd" ClientInstanceName="DateEnd" Width="96%" runat="server"></dx:ASPxDateEdit>
                            </td>
                            <td>
                                <dx:ASPxButton ID="btnZhuanHuanSJ" runat="server" Text="查询" AutoPostBack="false"
                                    UseSubmitBehavior="false">
                                    <ClientSideEvents Click="function(s, e) { Bind(); }" />
                                </dx:ASPxButton>
                                
                            </td>
                            <td>
                                 <%--<dx:ASPxButton ID="btnFH" runat="server" Text="返回" AutoPostBack="false" UseSubmitBehavior="false" Visible="false">
                                    <ClientSideEvents Click="function(s, e) { FH(); }" />
                                </dx:ASPxButton> --%>
                            </td>
                        </tr>
                    </table>
                    <dx:ASPxGridView ID="gvLH" ClientInstanceName="grid" OnCustomCallback="gvLH_CustomCallback" runat="server" AutoGenerateColumns="False" KeyFieldName="ID" Width="100%" Theme="Aqua1">
                        <Columns>
                            <dx:GridViewDataTextColumn FieldName="NUM" Caption="序号" Width="5%" HeaderStyle-HorizontalAlign="Center">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="S_WENJIANMC" Caption="文件名称" Width="55%" HeaderStyle-HorizontalAlign="Center">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="USERNAME" Caption="操作人" Width="10%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="D_CAOZUORQ" Caption="上传时间" Width="20%" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="操作" Width="10%" CellStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                                <DataItemTemplate>
                                    <a href="<%#Eval("S_WENJIANLJ") %>" target="view_window">查看</a>
                                    <a href='javascript:del(<%#Eval("ID") %>)' >删除</a>
                                </DataItemTemplate>
                            </dx:GridViewDataTextColumn>
                        </Columns>
                        <SettingsPager PageSize="30"></SettingsPager>
                        <Settings VerticalScrollableHeight="350" VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" />
                        <ClientSideEvents Init="OnInit" EndCallback="OnEndCallback" />
                    </dx:ASPxGridView>

                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
